/*
 * Propagation.h
 * Behavioral Attributed Automaton
 * @author Gregoire JACOB (gregoire.jacob@orange-ftgroup.com)
 * @date 01/12/2008
 * @version 2.2
 * Propagation parser automaton
 */

//Set of parallel automata for propagation
struct PARALLEL_AUTOMATA propagation;

//Set of combinatory (avoid duplicated graph)
#define POBJECTNB 20000
char PropObjectCombin[POBJECTNB][POBJECTNB];

/**
 * initPropagationAutomata()
 * Initialize the set of parallel automata as unique
 * automaton in a starting state
 */
void initPropagationAutomata();

/**
 * parseIntermediateRules()
 * @param the first argument identifier
 * @param the first argument type		
 * @param the second argument identifier	
 * @param the second argument type	
 * Parse the given rules and updates the automata
 * satisfying the syntactic and semantic rules
 */
void parsePropCreate(long argid, int argtype);
void parsePropOpen(long argid, int argtype);
void parsePropClose(long argid, int argtype);
void parsePropRead(long arg1id, int arg1type, long arg2id, int arg2type);
void parsePropWrite(long arg1id, int arg1type, long arg2id, int arg2type);
void parsePropDirectTransfer(long arg1id, int arg1type, long arg2id, int arg2type);
void parsePropAffect(long arg1id, int arg1type, long arg2id, int arg2type);
void parsePropInterleavedBegin();
void parsePropInterleavedEnd();

/**
 * updatePropagationAutomata()
 * @param the current operation
 * @param the first argument identifier		(optional (0))
 * @param the first argument type			(optional (0))
 * @param the second argument identifier	(optional (0))
 * @param the second argument type			(optional (0))
 * Updates the progression of the different automata according
 * to the current lexical unit. May start new automaton
 */
void updatePropagationAutomata(unsigned long operation,
							   long arg1id, int arg1type,
							   long arg2id, int arg2type);
